<?php
include_once dirname(__FILE__)."/../ini.php";
include_once ROOTDIR.'/common/header.php';

$ListVille=getVilleList();
$selectResidence_option= $ListResidence=getResidenceList('paris');
?>
<style type="text/css">
* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
</style>
  <script>
  $(document).ready(function(){
	$("#formValidate").validate();
	$("#submitButton").click(function(){
		
	nom=$("#idnom").val();
	pseudo=$("#idpseudo").val();
	residence=$("#idresidence").val();
	num_chambre=$("#idnumCh").val();
	telephone=$("#idphone").val();
	email=$("#idemail").val();
	password=$("#idpassword").val();
	ville=$("#villeList").val();
	$.ajax({
		url: "save.php",
		type:"POST",
		data: {nom:nom,pseudo:pseudo,residence_id_residence:residence,num_chambre:num_chambre,telephone:telephone,email:email,password:password,ville:ville},
		success: function(result){
		if(result=="OK"){
			alert(result);
		}
		else alert(result);

		}
		});
	return false;
	});

});
  
  </script>
  
<u>Bienvenue dans la page de creation de votre compte</u><br/><br/><br/>

<form id="formValidate" method="post" action="#">
<fieldset>
<table>
<tr>
	<td><label for="idnom">Nom</label></td>
	<td><input type="text" name="nom" value="" id="idnom" class=""/></td>
</tr>

<tr>
	<td><label for="iprenom">Prenom</label></td>
	<td><input type="text" name="prenom" value="" id="iprenom" class=""/></td>
</tr>

<tr>
	<td><label for="idpseudo">Pseudo</label></td>
	<td><input type="text" name="pseudo" value="" id="idpseudo" class=""/></td>
</tr>

<?php echo $selectResidence_option;
echo $ListVille;
?>

<tr>
	<td><label for="idnumch">Numero de chambre</label></td>
	<td><input type="text" name="numch" value="" id="idnumch" class=""/></td>
</tr>

<tr>
	<td><label for="idphone">Telephone</label></td>
	<td><input type="text" name="telephone" value="" id="idphone" class=""/></td>
</tr>

<tr>
	<td><label for="idemail">Email</label></td>
	<td><input type="text" name="email" value="" id="idemail" class=" " /></td>
</tr>

<tr>
	<td><label for="idpassword">Password</label></td>
	<td><input type="password" name="password" value="" id="idpassword" class="required "/></td>
</tr>
</table>
<input type="submit" class="" value="Submit" id="submitButton"/>

</fieldset>
</form>

